package com.llkj.qingnianguoxue.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.llkj.qingnianguoxue.R;
import com.llkj.qingnianguoxue.util.ImageLoadingUtil;
import com.llkj.qingnianguoxue.util.StringUtils;

import java.util.List;

/**
 * 举报图片适配器
 */
public class ReportPicsAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public ReportPicsAdapter(int layoutResId, List<String> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, String item) {
        ImageView ivCirclePic = baseViewHolder.getView(R.id.ivPic);

        if(baseViewHolder.getLayoutPosition()==mData.size()-1 && StringUtils.isEmpty(item)){
            ivCirclePic.setImageResource(R.drawable.icon_report_add);
        }else{
            ImageLoadingUtil.loadingUrl(ivCirclePic,item);
        }
    }

}
